package com.ysd.lis.controller.eq;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.eq.EqRunningRecord;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.eq.RunningRecordDto;
import com.ysd.lis.service.eq.EqRunningRecordService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备管理-设备类型 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-08-26
 */
@RestController
@RequestMapping("/api/eq/eqRunningRecord")
public class EqRunningRecordController extends BaseController {

    @Autowired
    EqRunningRecordService eqRunningRecordService;

    @ApiOperation("分页查询")
    @GetMapping("/findRunningRecordPageList")
    public Result findRunningRecordPageList(CommonPageDto pageParam){
        return eqRunningRecordService.findRunningRecordPageList(pageParam);
    }

    @ApiOperation("添加")
    @PostMapping("/addRunningRecord")
    public Result addRunningRecord(@RequestBody EqRunningRecord eqRunningRecord) {
        return eqRunningRecordService.addRunningRecord(eqRunningRecord);
    }
    @ApiOperation("编辑")
    @PostMapping("/updateRunningRecord")
    public Result updateRunningRecord(@RequestBody EqRunningRecord eqRunningRecord) {
        return eqRunningRecordService.updateRunningRecord(eqRunningRecord);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteRunningRecordList")
    public Result batchDeleteRunningRecordList(@RequestBody RunningRecordDto dto){
        return  eqRunningRecordService.batchDeleteRunningRecordList(dto);
    }

    @ApiOperation("根据ID查")
    @GetMapping("/findRunningRecordById")
    public Result findRunningRecordById( EqRunningRecord runningRecord) {
        return eqRunningRecordService.findRunningRecordById(runningRecord);
    }
}
